package java06;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class zy06 {
    public static void main(String[] args) {
        Integer[] arr1 = {1, 2, 3};
        Integer[] arr2 = {3, 4, 5, 2};

        Set<Integer> set1 = new HashSet<>(Arrays.asList(arr1));
        Set<Integer> set2 = new HashSet<>(Arrays.asList(arr2));

        List<Integer> result = Stream.concat(set1.stream(), set2.stream())
                .distinct()
                .filter(x -> !set1.contains(x) || !set2.contains(x))
                .collect(Collectors.toList());

        System.out.println(result); 
    }
}




